package logic.AuthLog

import cn.ibizlab.util.domain.EntityBase
import cn.ibizlab.util.helper.RuleUtils
import cn.ibizlab.util.security.AuthenticationUser
import cn.ibizlab.util.security.SpringContextHolder
import cn.ibizlab.core.authentication.domain.AuthLog
import cn.ibizlab.core.authentication.service.AuthLogService
import cn.ibizlab.core.authentication.domain.AuthLog
import cn.ibizlab.core.authentication.service.AuthLogService
import cn.ibizlab.core.authentication.domain.AuthLog
import cn.ibizlab.core.authentication.service.AuthLogService
import com.alibaba.fastjson.JSONObject
import org.springframework.util.ObjectUtils

/**
 *  查询集合并转换时间类型
 */
class FetchLog {

    //当前用户
    def curuser = AuthenticationUser.getAuthenticationUser()
    //日志过滤器
    def _log_filter
    //传入变量
    def _default = new AuthLog()
    //日志分页查询变量
    def _log_list = new AuthLog()
    //返回参数
    def _return

    def execute(arg) {
        println 'running....'
        _log_filter = arg
        
        
        _return = arg
        begin()
        println 'running end....'
        return _return
    }

    //开始
    def begin() {
    
        //连接名称
        if(true) {
            rawsfcode1()
        }
    }

    //结束
    def end1() {

    }

    //时间数据转换脚本
    def rawsfcode1() {
            if(!ObjectUtils.isEmpty(_log_list)){
            for(int i = 0; i < _log_list.getSize(); i++) {
            cn.ibizlab.core.authentication.domain.AuthLog authLog = (cn.ibizlab.core.authentication.domain.AuthLog) _log_list.getContent().get(i);
            authLog.setTime(new Date(authLog.getTimestmp()));
            _log_list.getContent().set(i, authLog);
            }
        }

        if(true) {
            end1()
        }
    }

}
